package cn.iocoder.yudao.module.infra.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 工单新增类型
 *
 */
@AllArgsConstructor
@Getter
public enum TicketAddTypeEnum {

    MANUAL(1, "内部手动创建"),
    TIMING(2, "内部定时创建"),
    ThREE_PARTIES(3,"三方手动创建");

    private final int code;
    private final String desc;

    private static final Map<Integer, String> descMap = Arrays.stream(values())
            .collect(Collectors.toMap(e -> e.code, e -> e.desc));

    public static String getDescByCode(Integer code) {
        return descMap.getOrDefault(code, "未知状态");
    }

}
